{template('../public/header.html')}

<!--广告列表-->
<div class="pad_10">
    <form name="searchform" method="get" >
    <table width="100%" cellspacing="0" class="search_form">
        <tbody>
            <tr>
            <td>
            <div class="explain_col">
            	<input type="hidden" name="m" value="admin" />
                <input type="hidden" name="c" value="ad" />
                <input type="hidden" name="a" value="index" />
                <input type="hidden" name="menuid" value="{$menuid}" />
            	{:L('ad_start_time')}：
            	<input type="text" name="start_time_min" id="start_time_min" class="date J_date_picker" size="12" value="{$search.start_time_min}">
                -
                <input type="text" name="start_time_max" id="start_time_max" class="date mr10 J_date_picker" size="12" value="{$search.start_time_max}">
                {:L('ad_end_time')}：
                <input type="text" name="end_time_min" id="end_time_min" class="date J_date_picker" size="12" value="{$search.end_time_min}">
                -
                <input type="text" name="end_time_max" id="end_time_max" class="date J_date_picker" size="12" value="{$search.end_time_max}">
            	<div class="bk3"></div>
                {:L('adboard')}：
                <select name="board_id" class="mr10">
                    <option value="">--{:L('all')}--</option>
					{foreach key board_list}
					<option value="{$key}" {if search("board_id")=key}selected="selected"{/if}>{:board_list(key)}</option>
					{/foreach}
                </select>
                {:L('ad_type')}：
                <select name="style" class="mr10">
                    <option value="">--不限--</option>
					{foreach key ad_type_arr}
					<option value="{$key}" {if search("style")=key}selected="selected"{/if}>{:ad_type_arr(key)}</option>
					{/foreach}
                </select>
                {:L('keyword')}：
                <input name="keyword" type="text" class="input-text mr10" size="25" value="{$search.keyword}" />
                <input type="submit" name="search" class="btn" value="搜索" />
				<input type="button" name="button" class="btn" value="重设" onclick="location='{:U('ad/index?menuid=' & menuid)}'" />
        	</div>
            </td>
            </tr>
        </tbody>
    </table>
    </form>
    
    <div class="J_tablelist table_list" data-acturi="{:U('ad/ajax_edit')}">
		<table width="100%" cellspacing="0">
        <thead>
          <tr>
            <th width="25"><input type="checkbox" name="checkall" class="J_checkall"></th>
            <th>ID</th>
            <th align="left"><span data-tdtype="order_by" data-field="name">{:L('ad_name')}</span></th>
            <th align="left"><span data-tdtype="order_by" data-field="url">{:L('ad_url')}</span></th>
            <th><span data-tdtype="order_by" data-field="type">{:L('ad_type')}</span></th>
            <th><span data-tdtype="order_by" data-field="board_id">{:L('adboard')}</span></th>
            <th width="150">有效时间</th>
            <th width="60"><span data-tdtype="order_by" data-field="ordid">{:L('sort_order')}</span></th>
            <th width="60"><span data-tdtype="order_by" data-field="status">{:L('status')}</span></th>
            <th width="80">{:L('operations_manage')}</th>
          </tr>
        </thead>
        <tbody>
		  {$rs type='rs' pagesize='0' }
          <tr>
            <td align="center"><input type="checkbox" class="J_checkitem" value="{$rs('id')}"></td>
            <td align="center">{$rs('id')}</td>
            <td><span data-tdtype="edit" data-field="name" data-id="{$rs('id')}" class="tdedit">{$rs('name')}</span></td>
            <td><span data-tdtype="edit" data-field="url" data-id="{$rs('id')}" class="tdedit">{$rs('url')}</span></td>
            <td align="center">
                {:ad_type_arr(rs('type').Value)}
				{if rs('type')='image'}
					{if trim(rs('content'))<>''}
						<span class="attachment_icon J_attachment_icon" file-type="image" file-path="{$img_dir}" file-rel="{$rs('content')}"></span>
						<!--<span class="attachment_icon J_preview" data-bimg=""></span>-->
					{/if}
                {/if}
            </td>
            <td align="center"><em class="red">(id:{$rs('board_id')})</em>
				<!--{:M('adboard')().where('id='& rs('board_id')).getField('name')}-->
				{asp}
				arr = M("adboard")().where("id="& rs("board_id")).getField("name,width,height")
				ab.c.echo arr(0) & " <font color='#aaaaaa'>(" & arr(1) & "*" & arr(2) & ")</font>"
				{/asp}
			</td>
            <td align="center">{@empty for="rs('start_time')"}--{@else}{:stdTime(rs('start_time'))}{/@empty} / {@empty for="rs('end_time')"}--{@else}{:stdTime(rs('end_time'))}{/@empty}</td>
            <td align="center"><span data-tdtype="edit" data-field="ordid" data-id="{$rs('id')}" class="tdedit">{$rs('ordid')}</span></td>
            <td align="center"><img data-tdtype="toggle" data-id="{$rs('id')}" data-field="status" data-value="{$rs('status')}" src="__STATIC__/images/admin/toggle_{if rs('status')=1}enabled{else}disabled{/if}.gif" /></td>
            <td align="center">
            	<a href="javascript:void(0);" class="J_showdialog" data-uri="{:U('ad/edit?id='& rs('id') )}" data-title="{:L('edit')} - {$rs('name')}" data-id="edit" data-width="550" data-height="410">{:L('edit')}</a> | 
                <a href="javascript:void(0);" class="J_confirmurl" data-acttype="ajax" data-uri="{:U('ad/delete?id='& rs('id') )}" data-msg="您确定要删除“<font color=blue>{$rs('name')}</font>”吗？">{:L('delete')}</a></td>
          </tr>
		{/$rs}
		{@empty for='rs'} <tr style="height:30px;"> <td align="left" colspan="10">&nbsp;&nbsp; <font color=red>暂无数据！</font></td> </tr>{/@empty}
        </tbody>
      	</table>
		<div class="btn_wrap_fixed">
    		<label class="select_all"><input type="checkbox" name="checkall" class="J_checkall">{:L('select_all')}/{:L('cancel')}</label>
            <input type="button" class="btn" data-tdtype="batch_action" data-acttype="ajax" data-uri="{:U('ad/delete')}" data-name="id" data-msg="{:L('confirm_delete')}" value="{:L('delete')}" />
			<div id="pages">
				{@pager data='rs'}
					{$pager("total")} 条记录 {$pager("no")}/{$pager("count")} 页 {if pager("count")>1}{$pager("bar")}{/if}
				{/@pager}
			</div>
    	</div>
    </div>
</div>

{template('../public/footer.html')}
</body>
</html>